<!doctype html>
<html lang="en">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <!--<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">-->
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <script type="text/javascript" src="/js/jquery-3.3.1.js"></script>
    <script type="text/javascript" src="/js/jquerySession.js"></script>

    <script type="text/javascript">

        $(function(){
            <!-- 时间戳转换 -->
            function timestampToTime(timestamp) {
                //var date = new Date(timestamp * 1000);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
                var date = new Date(timestamp);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
                Y = date.getFullYear() + '-';
                M = (date.getMonth() + 1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
                D = date.getDate() + ' ';
                h = date.getHours() + ':';
                m = date.getMinutes() + ':';
                s = date.getSeconds();
                return Y + M + D + h + m + s;
            }

            console.log("jquerySession : " + $.session.get('userName'));
            <!-- 取值: $("#spanid").text() 赋值: $("#spanid").html(value) -->
            <!-- replace(/(^")|("$)/g,'')  正则  去 html 前后 双引号  -->
            $("#useName").html($.session.get('userName').replace(/(^")|("$)/g,''));

            var year = new Date().getFullYear();
            var month = new Date().getMonth() + 1;
            var day = new Date().getDate();

            var thisWeekStart; //本周周一的时间
            if(new Date().getDay() == 0){  //周天的情况；
                thisWeekStart = (new Date(year + '/' + month + '/' + day)).getTime() -
                        ((new Date().getDay()) + 6) * 86400000;
            }else{
                thisWeekStart = (new Date(year + '/' + month + '/' + day)).getTime() -
                        ((new Date().getDay()) - 1) * 86400000;
            }

            $("#useName").html($.session.get('userName').replace(/(^")|("$)/g,''));



            console.log("year :" + year + " month :" + month + " day :" + day);
            console.log("thisWeekStart: " +  thisWeekStart  + "  " + timestampToTime(thisWeekStart));

        })

        function requestJson(){
            $("#userSeq").val($.session.get('userName').replace(/(^")|("$)/g,''));

            var loginFormData = $("#loginForm").serializeArray();
            var t = "{";
            $.each(loginFormData, function(i, value){
                t += "\"" + value.name + "\":\"" + value.value + "\"";
                if(loginFormData.length-1 != i){t += ',';}

            });
            t += "}";

            console.log(t);
            $.ajax({
                type:'post',
                url:'/week/single/add',
                contentType:'application/json;charset=utf-8',
                data:t,
                success:function(data){
                    alert("回显字段 userName = ");
                }
            });
        }
    </script>

    <!-- 自定义 CSS 样式 -->
    <style type="text/css">
        .gn-center {
            margin-top:-8px;
        }
        .form-control{
            width:80%;
        }
    </style>

    <title>Hello, world!11</title>
</head>
    <body>
        <form id ="loginForm" class="form-signin"  method="post">


            <input type="hidden" id="userSeq" name="userSeq">
            <!-- .table-responsive 响应式表格-->
            <div class="bs-example" data-example-id="simple-responsive-table">
                <div class="table-responsive">
                    <table class="table">
                        <thead>
                        <tr>
                            <th colspan="6" class="text-center">
                                <h3>软件中心 <span id="useName" name="useName"></span> 工作周报</h3></br>
                                <h5 class="gn-center"></h5>
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <th colspan="6">本周工作完成情况：</th>
                        </tr>
                        <tr>
                            <th colspan="6">一、重点工作进展情况</th>
                        </tr>
                        <tr>
                            <th colspan="6">（一）新核心项目群</br>
                                <textarea class="form-control text-center" rows="4" name="currentNewCorecontent"></textarea>
                            </th>
                        </tr>
                        <tr>
                            <th colspan="6">（二）两地三中心</br>
                                <textarea class="form-control text-center" rows="4" name="currentTwoSecond"></textarea>
                            </th>
                        </tr>

                        <!-- 第二部分 -->
                        <tr>
                            <th colspan="6">二、基础管理工作</th>
                        </tr>

                        <!-- 第三部分 -->
                        <tr>
                            <th colspan="6">三、项目建设情况</th>
                        </tr>
                        <tr>
                            <th colspan="6">（一）上线投产情况</br></th>
                        </tr>
                        <tr>
                            <th colspan="6">1.项目方面</br>
                                <textarea class="form-control text-center" rows="4" name="currentProjectUpdate"></textarea>
                            </th>
                        </tr>
                        <tr>
                            <th colspan="6">2.需求方面</br>
                                <textarea class="form-control text-center" rows="4" name="currentDemand"></textarea>
                            </th>
                        </tr>

                        <tr>
                            <th colspan="6">（二）招标进展情况</br>
                                <textarea class="form-control text-center" rows="4" name="currentBid"></textarea>
                            </th>
                        </tr>

                        <tr>
                            <th colspan="6">（三）商务进展情况</br>
                                <textarea class="form-control text-center" rows="4" name="currentBusiness"></textarea>
                            </th>
                        </tr>

                        <tr>
                            <th colspan="6">&nbsp;（四） 项目建设进展情况</br>
                                <textarea class="form-control text-center" rows="4" name="currentProjectProgess"></textarea>
                            </th>
                        </tr>

                        <tr>
                            <th colspan="6">&nbsp;四、团队建设开展情况</br>
                                <textarea class="form-control text-center" rows="4" name="currentTeamProcess"></textarea>
                            </th>
                        </tr>

                        <tr>
                            <th colspan="6">&nbsp;五、日常工作</br>
                                <textarea class="form-control text-center" rows="4" name="currentDaily"></textarea>
                            </th>
                        </tr>

                        <tr>
                            <th colspan="6">&nbsp;六、存在问题及进展情况</br>
                                <textarea class="form-control text-center" rows="4" name="currentProblem"></textarea>
                            </th>
                        </tr>

                        <tr>
                            <th colspan="6">&nbsp;七、其它工作</br>
                                <textarea class="form-control text-center" rows="4" name="currentOther"></textarea>
                            </th>
                        </tr>

                        <tr>
                            <th colspan="6">下周工作计划：</th>
                        </tr>

                        <tr>
                            <th colspan="6">一、重点工作进展情况</th>
                        </tr>

                        <!-- 下周工作 -->

                        <tr>
                            <th colspan="6">（一）新核心项目群</br>
                                <textarea class="form-control text-center" rows="4" name="nextNewCorecontent"></textarea>
                            </th>
                        </tr>
                        <tr>
                            <th colspan="6">（二）两地三中心</br>
                                <textarea class="form-control text-center" rows="4" name="nextTwoSecond"></textarea>
                            </th>
                        </tr>

                        <!-- 第二部分 -->
                        <tr>
                            <th colspan="6">二、基础管理工作</th>
                        </tr>

                        <!-- 第三部分 -->
                        <tr>
                            <th colspan="6">三、项目建设情况</th>
                        </tr>
                        <tr>
                            <th colspan="6">（一）上线投产情况</br></th>
                        </tr>
                        <tr>
                            <th colspan="6">1.项目方面</br>
                                <textarea class="form-control text-center" rows="4" name="nextProjectUpdate"></textarea>
                            </th>
                        </tr>
                        <tr>
                            <th colspan="6">2.需求方面</br>
                                <textarea class="form-control text-center" rows="4" name="nextDemand"></textarea>
                            </th>
                        </tr>

                        <tr>
                            <th colspan="6">（二）招标进展情况</br>
                                <textarea class="form-control text-center" rows="4" name="nextBid"></textarea>
                            </th>
                        </tr>

                        <tr>
                            <th colspan="6">（三）商务进展情况</br>
                                <textarea class="form-control text-center" rows="4" name="nextBusiness"></textarea>
                            </th>
                        </tr>

                        <tr>
                            <th colspan="6">&nbsp;（四） 项目建设进展情况</br>
                                <textarea class="form-control text-center" rows="4" name="nextProjectProgess"></textarea>
                            </th>
                        </tr>

                        <tr>
                            <th colspan="6">&nbsp;四、团队建设开展情况</br>
                                <textarea class="form-control text-center" rows="4" name="nextTeamProcess"></textarea>
                            </th>
                        </tr>

                        <tr>
                            <th colspan="6">&nbsp;五、日常工作</br>
                                <textarea class="form-control text-center" rows="4" name="nextDaily"></textarea>
                            </th>
                        </tr>

                        <tr>
                            <th colspan="6">&nbsp;六、存在问题及进展情况</br>
                                <textarea class="form-control text-center" rows="4" name="nextProblem"></textarea>
                            </th>
                        </tr>

                        <tr>
                            <th colspan="6">&nbsp;七、其它工作</br>
                                <textarea class="form-control text-center" rows="4" name="nextOther"></textarea>
                            </th>
                        </tr>


                        </tbody>
                    </table>
                </div><!-- /.table-responsive -->
            </div><!-- /example -->
            </div>
            <input class="btn btn-lg btn-primary btn-block" type="button" onclick="requestJson()">ajax</input>
        </form>
    </body>
</html>